// JavaScript Document
function validate1()
{
	
	if(document.questionnaire1.district[document.questionnaire1.district.selectedIndex].value==0)
	{
	  alert("Please Select District Name");
	  document.questionnaire1.district.focus();
	   return false;
	}
	if(document.questionnaire1.block[document.questionnaire1.block.selectedIndex].value==0)
	{
	  alert("Please Select Block Name");
	  document.questionnaire1.block.focus();
	   return false;
	}
	if(document.questionnaire1.panchayat[document.questionnaire1.panchayat.selectedIndex].value==0)
	{
	  alert("Please Select Gram Panchayat Name");
	  document.questionnaire1.panchayat.focus();
	   return false;
	}
	if(document.questionnaire1.village[document.questionnaire1.village.selectedIndex].value==0)
	{
	  alert("Please Select Village Name");
	  document.questionnaire1.village.focus();
	   return false;
	}
		
	if(document.getElementById('name_scheme').value=="")
	{
	   alert('Please Enter Name of Scheme');
	   document.getElementById('name_scheme').focus();
	   return false;
	 }
	/*if(document.getElementById('capital_cost').value=="")
	{
	   alert('Please Enter Capital Cost');
	   document.getElementById('capital_cost').focus();
	   return false;
	 }
	 if(document.getElementById('capital_cost').value.length>5)
	{
		alert('Capital Cost Should be Max 5 Character');
		document.getElementById('capital_cost').focus();
		return false;
		
	}*/
	/*var chks = document.getElementsByName('scheme_sactioned'+'[]');
     var hasChecked = false;
     for (var i = 0; i < chks.length; i++)
     {
     	if (chks[i].checked)
     	{
     		hasChecked = true;
     		break;
     	}
     }
	 if (hasChecked == false)
    {
    	alert("Please Select at Least One Scheme Sanctioned");
    	return false;
    }
	var chks = document.getElementsByName('scheme_sactioned'+'[]');
     var hasChecked = false;
     for (var i = 1; i < chks.length; i++)
     {
     	if (chks[i].checked)
     	{
	 //alert(chks[i].value);
	 		if(chks[i].value=="" && document.getElementById('scheme_sactioned_other').value=="")
	 		{
	    		alert("Please Enter Scheme Sanctioned Under Other Field");
				document.getElementById('scheme_sactioned_other').focus();
				return false;
	 		}
	 	}
	 }*/
	
	if(document.getElementById('scheme_sactioned')[document.getElementById('scheme_sactioned').selectedIndex].value==0)
		{
			alert('Please Select Type of Scheme Sanctioned');
			document.getElementById('scheme_sactioned').focus();
			return false;
		}
		
	if(document.getElementById('scheme_sactioned')[document.getElementById('scheme_sactioned').selectedIndex].value=='Other' && document.getElementById('scheme_sactioned_other').value=="")
		{
			alert('Please Enter Scheme Sanctioned of Other Field');
			document.getElementById('scheme_sactioned_other').focus();
			return false;
		}
	
	
	
	
	
	var flagCancel=false;
	var counthab=document.getElementById('habcount').value;
	for(var i=1;i<=counthab;i++)
	{
		if(document.getElementById('status'+i).value=="Existing")
		{
			flagCancel=true;
		}
	}
		if(flagCancel==false)
		{
			
			var r=confirm('If All Habitations are Non Tracable then Form will be Canceled!If any Habitation is Existing Press OK otherwise Click Canceled');
    		if(r==true)
			{
				for(var i=1;i<=counthab;i++)
	   			{
					document.getElementById('status'+i).focus();
					return false;
				}
	
			}
			alert('Fill Up Form is Canceled');
			location.reload(true);
			document.getElementById('district').focus();
			return false;
						
		}
	
	
	//Error in status
	
	/*var counthabit=document.getElementById('habcount').value;
	for(var i=1;i<=counthabit;i++)
	{
	
	if(!document.getElementById('status'+i).checked)
	{                        								
	//while(i>=counthabit)	
	var r=confirm('If All Habitations are Non Tracable then Form will be Canceled!If any Habitation is Existing Press OK otherwise Click Canceled');
    if(r==true)
	{
	     document.getElementById('status'+i).focus();
		 return false;
	
	}
	alert('Fill Up Form is Canceled');
	location.reload(true);
	return false;
	}
	}*/
	
	
	/*if(document.getElementById('popul_benefited').value=="")
	{
	   alert('Please Enter Population Benifited Field');
	   document.getElementById('popul_benefited').focus();
	   return false;
	 }
	 var a=document.getElementById('population_benefited1').value;
	 var b=document.getElementById('present_population1').value;
	 var c=document.getElementById('factor1').value;
	 alert(b);
	 alert('Value of Population Benefited Field is '+ a +' , Present Population is '+ b +' and Population Factor is ' + c);*/
    	/*if(r==false)
		{
		
			document.getElementById('popul_benefited').focus();
			return false;
		}*/
	 /*if(document.getElementById('present_popul').value=="")
	{
	   alert('Please Enter Present Population Field');
	   document.getElementById('present_popul').focus();
	   return false;
	 }*/
	 /*if(document.getElementById('num_source').value=="")
	{
	   alert('Please Enter No. of Source');
	   document.getElementById('num_source').focus();
	   return false;
	 }*/
	 
	var countsource=document.getElementById('sourcecount').value;
	for(var i=1;i<=countsource;i++)
	{
		if(document.getElementById('source'+i)[document.getElementById('source'+i).selectedIndex].value==0)
		{
			alert('Please Select Source'+i);
			document.getElementById('source'+i).focus();
			return false;
		}
	
	if(document.getElementById('current_status'+i).value=="operation")
	{
		if(document.getElementById('yield_min'+i).value=="")
		{
	     alert('Please Enter Source Detail in yield Min'+i);
		 document.getElementById('yield_min'+i).focus();
		 return false;
		}
		if(document.getElementById('yield_max'+i).value=="")
		{
	     alert('Please Enter Source Detail in Yield Max'+i);
		 document.getElementById('yield_max'+i).focus();
		 return false;
		}
		if(document.getElementById('water_table_min'+i).value=="")
		{
	     alert('Please Enter Source Detail in Water Table Min'+i);
		 document.getElementById('water_table_min'+i).focus();
		 return false;
		}
		if(document.getElementById('water_table_max'+i).value=="")
		{
	     alert('Please Enter Source Detail in Water Max'+i);
		 document.getElementById('water_table_max'+i).focus();
		 return false;
		}
	}
	 /*var chks = document.getElementsByName('current_status'+i);
     var hasChecked = false;
     for (var j = 0; j < chks.length; j++)
     {
     	if (chks[j].checked)
     	{
     		hasChecked = true;
     		break;
     	}
     }
	 if (hasChecked == false)
    {
    	alert("Please Select at Least One Current Status");
    	return false;
    }*/
	}
	if(document.getElementById('hp_no').value=="")
	{
	     alert('Please Enter HP No.');
		 document.getElementById('hp_no').focus();
		 return false;
	}
	if(document.getElementById('sp_no').value=="")
	{
	     alert('Please Enter SP No.');
		 document.getElementById('sp_no').focus();
		 return false;
	}
}


function setReadOnly(valobj,obj)
{
	document.getElementById('status'+obj).value="NON TRACABLE";
	document.getElementById('cover1'+obj).checked=true;
}

function setEnable(valobj,obj)
{
	document.getElementById('status'+obj).value="Existing";
	document.getElementById('cover'+obj).checked=true;
}

function setReadOnly22(valobj,obj)
{
		//document.getElementById('household'+obj).style.backgroundcolor="#eeeeee";
		//document.getElementById('population_sc1').readonly=1;
		//document.getElementById('population_sc1').value="Not Applicable";
		document.getElementById('yield_min'+obj).disabled=true;
		document.getElementById('yield_max'+obj).disabled=true;
		document.getElementById('water_table_min'+obj).disabled=true;
		document.getElementById('water_table_max'+obj).disabled=true;
		//document.getElementById('source'+obj).disabled=true;
		document.getElementById('para_ph'+obj).disabled=true;
		document.getElementById('para_tds'+obj).disabled=true;
		document.getElementById('para_f'+obj).disabled=true;
		document.getElementById('para_cl'+obj).disabled=true;
		document.getElementById('para_no3'+obj).disabled=true;
		document.getElementById('testing_date'+obj).disabled=true;
		document.getElementById('my'+obj).style.visibility = 'hidden';
		document.getElementById('current_status'+obj).value="defunct";
   
}
function setEnable22(valobj,obj)
{

		//document.getElementById('population_sc1').style.backgroundcolor="#ffffff";
		//document.getElementById('population_sc1').readonly=0;
		//document.getElementById('population_sc1').value="";
		document.getElementById('yield_min'+obj).disabled=false;
		document.getElementById('yield_max'+obj).disabled=false;
		document.getElementById('water_table_min'+obj).disabled=false;
		document.getElementById('water_table_max'+obj).disabled=false;
		//document.getElementById('source'+obj).disabled=false;
		document.getElementById('para_ph'+obj).disabled=false;
		document.getElementById('para_tds'+obj).disabled=false;
		document.getElementById('para_f'+obj).disabled=false;
		document.getElementById('para_cl'+obj).disabled=false;
		document.getElementById('para_no3'+obj).disabled=false;
		document.getElementById('testing_date'+obj).disabled=false;
		document.getElementById('my'+obj).style.visibility = 'visible';
		document.getElementById('current_status'+obj).value="operation";
	
}

function enable_sanc(status)
{
  status=!status;
  document.getElementById('scheme_sactioned_other').disabled=status;
}

function enable_sanc1(status)
{
  
	if(document.getElementById('scheme_sactioned')[document.getElementById('scheme_sactioned').selectedIndex].value=='Other')
	{
  		status=!status;
  		document.getElementById('scheme_sactioned_other').disabled=status;
  		document.getElementById('scheme_sactioned_other').focus();
	}
	else
	{
		document.getElementById('scheme_sactioned_other').disabled=true;	
	}

}

function setReadOnly2(valobj,obj)
{
		//document.getElementById('household'+obj).style.backgroundcolor="#eeeeee";
		//document.getElementById('population_sc1').readonly=1;
		//document.getElementById('population_sc1').value="Not Applicable";
		document.getElementById('sub_discharge'+obj).disabled=true;
		document.getElementById('sub_head'+obj).disabled=true;
		document.getElementById('sub_power'+obj).disabled=true;
		//document.getElementById('water_table_max'+obj).disabled=true;
		//document.getElementById('source'+obj).disabled=true;
		document.getElementById('sub_status'+obj).value="standby";
   
}
function setEnable2(valobj,obj)
{

		//document.getElementById('population_sc1').style.backgroundcolor="#ffffff";
		//document.getElementById('population_sc1').readonly=0;
		//document.getElementById('population_sc1').value="";
		document.getElementById('sub_discharge'+obj).disabled=false;
		document.getElementById('sub_head'+obj).disabled=false;
		//document.getElementById('water_table_min'+obj).disabled=false;
		document.getElementById('sub_power'+obj).disabled=false;
		//document.getElementById('source'+obj).disabled=false;
		document.getElementById('sub_status'+obj).value="operational";
	
}

function setReadOnly21(valobj,obj)
{
		//document.getElementById('household'+obj).style.backgroundcolor="#eeeeee";
		//document.getElementById('population_sc1').readonly=1;
		//document.getElementById('population_sc1').value="Not Applicable";
		document.getElementById('mono_discharge'+obj).disabled=true;
		document.getElementById('mono_head'+obj).disabled=true;
		document.getElementById('mono_power'+obj).disabled=true;
		//document.getElementById('water_table_max'+obj).disabled=true;
		//document.getElementById('source'+obj).disabled=true;
		document.getElementById('mono_status'+obj).value="standby";
   
}
function setEnable21(valobj,obj)
{

		//document.getElementById('population_sc1').style.backgroundcolor="#ffffff";
		//document.getElementById('population_sc1').readonly=0;
		//document.getElementById('population_sc1').value="";
		document.getElementById('mono_discharge'+obj).disabled=false;
		document.getElementById('mono_head'+obj).disabled=false;
		//document.getElementById('water_table_min'+obj).disabled=false;
		document.getElementById('mono_power'+obj).disabled=false;
		//document.getElementById('source'+obj).disabled=false;
		document.getElementById('mono_status'+obj).value="operational";
	
}

function setReadOnly211(valobj,obj)
{
		//document.getElementById('household'+obj).style.backgroundcolor="#eeeeee";
		//document.getElementById('population_sc1').readonly=1;
		//document.getElementById('population_sc1').value="Not Applicable";
		document.getElementById('centi_discharge'+obj).disabled=true;
		document.getElementById('centi_head'+obj).disabled=true;
		document.getElementById('centi_power'+obj).disabled=true;
		//document.getElementById('water_table_max'+obj).disabled=true;
		//document.getElementById('source'+obj).disabled=true;
		document.getElementById('centi_status'+obj).value="standby";
   
}
function setEnable211(valobj,obj)
{

		//document.getElementById('population_sc1').style.backgroundcolor="#ffffff";
		//document.getElementById('population_sc1').readonly=0;
		//document.getElementById('population_sc1').value="";
		document.getElementById('centi_discharge'+obj).disabled=false;
		document.getElementById('centi_head'+obj).disabled=false;
		//document.getElementById('water_table_min'+obj).disabled=false;
		document.getElementById('centi_power'+obj).disabled=false;
		//document.getElementById('source'+obj).disabled=false;
		document.getElementById('centi_status'+obj).value="operational";
	
}

function setReadOnly212(valobj,obj)
{
		//document.getElementById('household'+obj).style.backgroundcolor="#eeeeee";
		//document.getElementById('population_sc1').readonly=1;
		//document.getElementById('population_sc1').value="Not Applicable";
		document.getElementById('sp_discharge'+obj).disabled=true;
		document.getElementById('sp_head'+obj).disabled=true;
		document.getElementById('sp_power'+obj).disabled=true;
		//document.getElementById('water_table_max'+obj).disabled=true;
		//document.getElementById('source'+obj).disabled=true;
		document.getElementById('sp_status'+obj).value="standby";
   
}
function setEnable212(valobj,obj)
{

		//document.getElementById('population_sc1').style.backgroundcolor="#ffffff";
		//document.getElementById('population_sc1').readonly=0;
		//document.getElementById('population_sc1').value="";
		document.getElementById('sp_discharge'+obj).disabled=false;
		document.getElementById('sp_head'+obj).disabled=false;
		//document.getElementById('water_table_min'+obj).disabled=false;
		document.getElementById('sp_power'+obj).disabled=false;
		//document.getElementById('source'+obj).disabled=false;
		document.getElementById('sp_status'+obj).value="operational";
	
}

/*function checkforInteger(value)
{ 

    if (parseInt(value) != value) 

     return false; 

     else return true; 

} 

//Returns true if given input is valid float  else return false  

function checkforPrice(value)
{ 

  if (isNaN(parseFloat(value))) 
	{
    return false; 
	}
    else
	{
	alert('not float');
	}
} */



function validate2()
{
     if(document.getElementById('population').value=="")
	{
	   alert('Please Enter Population Field! If You Have No Data Fill 0');
	   document.getElementById('population').focus();
	   return false;
	}
	
	     //document.getElementById('status'+i).focus();
		 //return false;
	
	if(document.getElementById('sub_total').value=="")
	{
		var r=confirm('If You have Data for Submersible Field Then Click OK Otherwise Click Cancel');
    	if(r==true)
		{
		
			document.getElementById('sub_total').focus();
			return false;
		}
	}
	if(document.getElementById('sub_total').value!="")
	{
		
		var countsubm=document.getElementById('submcount').value;
		for(var i=1;i<=countsubm;i++)
		{
		
			//document.getElementById('sub_total').focus();
			if(document.getElementById('sub_status'+i).value=="operational")
			{
				if(document.getElementById('sub_discharge'+i).value=="")
				{
	     			alert('Please Enter Submersible Discharge'+i);
		 			document.getElementById('sub_discharge'+i).focus();
		 			return false;
				}
				if(document.getElementById('sub_head'+i).value=="")
				{
	     			alert('Please Enter Submersible Head'+i);
		 			document.getElementById('sub_head'+i).focus();
		 			return false;
				}
				if(document.getElementById('sub_power'+i).value=="")
				{
	     			alert('Please Enter Submersible Power'+i);
		 			document.getElementById('sub_power'+i).focus();
		 			return false;
				}
			
			}
		}
	}
	//}
	
   if(document.getElementById('mono_total').value=="")
	{
		var r=confirm('If You have Data for Mono Block Field Then Click OK Otherwise Click Cancel');
    	if(r==true)
		{
		
			document.getElementById('mono_total').focus();
			return false;
		}
	}
	if(document.getElementById('mono_total').value!="")
	{
   		var countmono=document.getElementById('monocount').value;
		for(var i=1;i<=countmono;i++)
		{
			if(document.getElementById('mono_status'+i).value=="operational")
			{
				if(document.getElementById('mono_discharge'+i).value=="")
				{
					alert('Please Enter Mono- Block Discharge'+i);
					document.getElementById('mono_discharge'+i).focus();
					return false;
				}
				if(document.getElementById('mono_head'+i).value=="")
				{
					alert('Please Enter Mono- Block Head'+i);
					document.getElementById('mono_head'+i).focus();
					return false;
				}
				if(document.getElementById('mono_power'+i).value=="")
				{
					alert('Please Enter Mono- Block Power'+i);
					document.getElementById('mono_power'+i).focus();
					return false;
				}
			
			}
		}
	}
   
   if(document.getElementById('centi_total').value=="")
	{
		var r=confirm('If You have Data for Centrifugal Field Then Click OK Otherwise Click Cancel');
    	if(r==true)
		{
		
			document.getElementById('centi_total').focus();
			return false;
		}
	}
	if(document.getElementById('centi_total').value!="")
	{
   		var countcenti=document.getElementById('centicount').value;
		for(var i=1;i<=countcenti;i++)
		{
			if(document.getElementById('centi_status'+i).value=="operational")
			{
				if(document.getElementById('centi_discharge'+i).value=="")
				{
					alert('Please Enter Centrifugal Discharge'+i);
					document.getElementById('centi_discharge'+i).focus();
					return false;
				}
				if(document.getElementById('centi_head'+i).value=="")
				{
					alert('Please Enter Centrifugal Head'+i);
					document.getElementById('centi_head'+i).focus();
					return false;
				}
				if(document.getElementById('centi_power'+i).value=="")
				{
					alert('Please Enter Centrifugal Power'+i);
					document.getElementById('centi_power'+i).focus();
					return false;
				}
			
			}
		}
	}
	
	if(document.getElementById('sp_total').value=="")
	{
		var r=confirm('If You have Data for Single Phase Field Then Click OK Otherwise Click Cancel');
    	if(r==true)
		{
		
			document.getElementById('sp_total').focus();
			return false;
		}
	}
	if(document.getElementById('sp_total').value!="")
	{
		var countsp=document.getElementById('spcount').value;
		for(var i=1;i<=countsp;i++)
		{
			if(document.getElementById('sp_status'+i).value=="operational")
			{
				if(document.getElementById('sp_discharge'+i).value=="")
				{
					alert('Please Enter Single Phase Discharge'+i);
					document.getElementById('sp_discharge'+i).focus();
					return false;
				}
				if(document.getElementById('sp_head'+i).value=="")
				{
					alert('Please Enter Single Phase Head'+i);
					document.getElementById('sp_head'+i).focus();
					return false;
				}
				if(document.getElementById('sp_power'+i).value=="")
				{
					alert('Please Enter Single Phase Power'+i);
					document.getElementById('sp_power'+i).focus();
					return false;
				}
			
			}
		}
	}
   /*if(document.getElementById('water_demand').value=="")
	{
	   alert('Please Enter Water Demand Field');
	   document.getElementById('water_demand').focus();
	   return false;
	}*/
    /*if(document.getElementById('sub_total').value=="")
	{
	   alert('Please Enter Submersible Pump in Total Field!If No Data Write NP');
	   document.getElementById('sub_total').focus();
	   return false;
	}
	
	a1=document.getElementById('sub_operational').value;
    a11=Number(a1);
    a2=document.getElementById('sub_stand').value;
    a22=Number(a2);
    a3=(a11+a22);
   if(a1!="NP" && a2!="NP")
   {
   		if(document.getElementById('sub_total').value!=a3)
   		{
   		 alert('Please Check! Total Number of Submersible Pump and Operational & Stand by should be Equal');
   			document.getElementById('sub_total').select();
   			return false;
   		}
   }
   if(a1=="NP" && a2!="NP")
   {
	   //a5=(a22+a33);
   		if(document.getElementById('sub_total').value!=a22)
   		{
   			alert('Please Check! Total Number of Submersible Pump and Operational & Stand by should be Equal');
  			document.getElementById('sub_total').select();
   			return false;
   		}
   }
   if(a2=="NP" && a1!="NP")
   {
	   
   		if(document.getElementById('sub_total').value!=a11)
   		{
   			alert('Please Check! Total Number of Submersible Pump and Operational & Stand by Should be Equal');
   			document.getElementById('sub_total').select();
   			return false;
   		}
   }
   
   if(a1=="NP" && a2=="NP" && document.getElementById('sub_total').value!="NP")
   {
	   
   alert('Please Check! Total Number of Submersible Pump and Operational & Stand by Should be Equal');
   document.getElementById('sub_total').select();
   return false;
   }
	if(document.getElementById('sub_operational').value=="")
	{
	   alert('Please Enter Submersible Pump in Operational Field!If No Data Write NP');
	   document.getElementById('sub_operational').focus();
	   return false;
	}
	if(document.getElementById('sub_stand').value=="")
	{
	   alert('Please Enter Submersible Pump in Standby Field!If No Data Write NP');
	   document.getElementById('sub_stand').focus();
	   return false;
	}
	
	
	if(document.getElementById('sub_discharge').value=="")
	{
	   alert('Please Enter Submersible in Discharge Field');
	   document.getElementById('sub_discharge').focus();
	   return false;
	}
	if(document.getElementById('sub_head').value=="")
	{
	   alert('Please Enter Submersible in Head Field');
	   document.getElementById('sub_head').focus();
	   return false;
	}
	if(document.getElementById('sub_power').value=="")
	{
	   alert('Please Enter Submersible in Power Field');
	   document.getElementById('sub_power').focus();
	   return false;
	}	
	
	
	if(document.getElementById('mono_total').value=="")
	{
	   alert('Please Enter Mono- Block Pump in Total Field');
	   document.getElementById('mono_total').focus();
	   return false;
	}
	
	a1=document.getElementById('mono_operational').value;
    a11=Number(a1);
    a2=document.getElementById('mono_stand').value;
    a22=Number(a2);
    a3=(a11+a22);
   if(a1!="NP" && a2!="NP")
   {
   		if(document.getElementById('mono_total').value!=a3)
   		{
   		    alert('Please Check! Total Number of Mono- Block Pump and Operational & Stand by Should be Equal');
   			document.getElementById('mono_total').select();
   			return false;
   		}
   }
   if(a1=="NP" && a2!="NP")
   {
	   
   		if(document.getElementById('mono_total').value!=a22)
   		{
   			alert('Please Check! Total Number of Mono- Block Pump and Operational & Stand by Should be Equal');
  			document.getElementById('mono_total').select();
   			return false;
   		}
   }
   if(a2=="NP" && a1!="NP")
   {
	   
   		if(document.getElementById('mono_total').value!=a11)
   		{
   			alert('Please Check! Total Number of Mono- Block Pump and Operational & Stand by Should be Equal');
   			document.getElementById('mono_total').select();
   			return false;
   		}
   }
   
   if(a1=="NP" && a2=="NP" && document.getElementById('mono_total').value!="NP")
   {
	   
   alert('Please Check! Total Number of Mono- Block Pump and Operational & Stand by should be Equal');
   document.getElementById('mono_total').select();
   return false;
   }
	if(document.getElementById('mono_operational').value=="")
	{
	   alert('Please Enter Mono- Block Pump in Operational Field!If No Data Write NP');
	   document.getElementById('mono_operational').focus();
	   return false;
	}
	if(document.getElementById('mono_stand').value=="")
	{
	   alert('Please Enter Mono- Block Pump in Standby Field!If No Data Write NP');
	   document.getElementById('mono_stand').focus();
	   return false;
	}
	
	
	if(document.getElementById('mono_discharge').value=="")
	{
	   alert('Please Enter Mono- Block in Discharge Field');
	   document.getElementById('mono_discharge').focus();
	   return false;
	}
	if(document.getElementById('mono_head').value=="")
	{
	   alert('Please Enter Mono- Block in Head Field');
	   document.getElementById('mono_head').focus();
	   return false;
	}
	if(document.getElementById('mono_power').value=="")
	{
	   alert('Please Enter Mono- Block in Power Field');
	   document.getElementById('mono_power').focus();
	   return false;
	}
		
	
	if(document.getElementById('centi_total').value=="")
	{
	   alert('Please Enter Centrifugal Pump in Total Field');
	   document.getElementById('centi_total').focus();
	   return false;
	}
	
	a1=document.getElementById('centi_operational').value;
    a11=Number(a1);
    a2=document.getElementById('centi_stand').value;
    a22=Number(a2);
    a3=(a11+a22);
   if(a1!="NP" && a2!="NP")
   {
   		if(document.getElementById('centi_total').value!=a3)
   		{
   		    alert('Please Check! Total Number of Centrifugal Pump and Operational & Stand by Should be Equal');
   			document.getElementById('centi_total').select();
   			return false;
   		}
   }
   if(a1=="NP" && a2!="NP")
   {
	   
   		if(document.getElementById('centi_total').value!=a22)
   		{
   			alert('Please Check! Total Number of Centrifugal Pump and Operational & Stand by Should be Equal');
  			document.getElementById('centi_total').select();
   			return false;
   		}
   }
   if(a2=="NP" && a1!="NP")
   {
	   
   		if(document.getElementById('centi_total').value!=a11)
   		{
   			alert('Please Check! Total Number of Centrifugal Pump and Operational & Stand by Should be Equal');
   			document.getElementById('centi_total').select();
   			return false;
   		}
   }
   
   if(a1=="NP" && a2=="NP" && document.getElementById('centi_total').value!="NP")
   {
	   
   alert('Please Check! Total Number of Centrifugal Pump and Operational & Stand by Should be Equal');
   document.getElementById('centi_total').select();
   return false;
   }
	
	if(document.getElementById('centi_operational').value=="")
	{
	   alert('Please Enter Centrifugal Pump in Operational Field!If No Data Write NP');
	   document.getElementById('centi_operational').focus();
	   return false;
	}
	if(document.getElementById('centi_stand').value=="")
	{
	   alert('Please Enter Centrifugal Pump in Standby Field!If No Data Write NP');
	   document.getElementById('centi_stand').focus();
	   return false;
	}
	
	
	if(document.getElementById('centi_discharge').value=="")
	{
	   alert('Please Enter Centrifugal in Discharge Field');
	   document.getElementById('centi_discharge').focus();
	   return false;
	}
	if(document.getElementById('centi_head').value=="")
	{
	   alert('Please Enter Centrifugal in Head Field');
	   document.getElementById('centi_head').focus();
	   return false;
	}
	if(document.getElementById('centi_power').value=="")
	{
	   alert('Please Enter Centrifugal in Power Field');
	   document.getElementById('centi_power').focus();
	   return false;
	}	
	
	if(document.getElementById('sp_total').value=="")
	{
	   alert('Please Enter Single Phase Pump in Total Field');
	   document.getElementById('sp_total').focus();
	   return false;
	}
	
	a1=document.getElementById('sp_operational').value;
    a11=Number(a1);
    a2=document.getElementById('sp_stand').value;
    a22=Number(a2);
    a3=(a11+a22);
   if(a1!="NP" && a2!="NP")
   {
   		if(document.getElementById('sp_total').value!=a3)
   		{
   		    alert('Please Check! Total Number of Single Phase Pump and Operational & Stand by Should be Equal');
   			document.getElementById('sp_total').select();
   			return false;
   		}
   }
   if(a1=="NP" && a2!="NP")
   {
	   
   		if(document.getElementById('sp_total').value!=a22)
   		{
   			alert('Please Check! Total Number of Single Phase Pump and Operational & Stand by Should be Equal');
  			document.getElementById('sp_total').select();
   			return false;
   		}
   }
   if(a2=="NP" && a1!="NP")
   {
	   
   		if(document.getElementById('sp_total').value!=a11)
   		{
   			alert('Please Check! Total Number of Single Phase Pump and Operational & Stand by Should be Equal');
   			document.getElementById('sp_total').select();
   			return false;
   		}
   }
   
   if(a1=="NP" && a2=="NP" && document.getElementById('sp_total').value!="NP")
   {
	   
   		alert('Please Check! Total Number of Single Phase Pump and Operational & Stand by Should be Equal');
   		document.getElementById('sp_total').select();
   		return false;
   }
	if(document.getElementById('sp_operational').value=="")
	{
	   alert('Please Enter Single Phase Pump in Operational Field!If No Data Write NP');
	   document.getElementById('sp_operational').focus();
	   return false;
	}
	if(document.getElementById('sp_stand').value=="")
	{
	   alert('Please Enter Single Phase Pump in Standby Field!If No Data Write NP');
	   document.getElementById('sp_stand').focus();
	   return false;
	}	
	
	
	if(document.getElementById('sp_discharge').value=="")
	{
	   alert('Please Enter Single Phase in Discharge Field');
	   document.getElementById('sp_discharge').focus();
	   return false;
	}
	if(document.getElementById('sp_head').value=="")
	{
	   alert('Please Enter Single Phase in Head Field');
	   document.getElementById('sp_head').focus();
	   return false;
	}
	if(document.getElementById('sp_power').value=="")
	{
	   alert('Please Enter Single Phase in Power Field');
	   document.getElementById('sp_power').focus();
	   return false;
	}*/
	
	if(document.getElementById('cwr_total').value=="")
	{
		var r=confirm('If You have Data for CWR Field Then Click OK Otherwise Click Cancel');
    	if(r==true)
		{
		
			document.getElementById('cwr_total').focus();
			return false;
		}
	}
	if(document.getElementById('cwr_total').value!="")
	{
		var countcwr=document.getElementById('cwrcount').value;
		for(var i=1;i<=countcwr;i++)
		{
			if(document.getElementById('cwr_total').value!="" && document.getElementById('cwr_capacity'+i).value=="")
			{
				alert('Please Enter Capacity in CWR Field'+i);
				document.getElementById('cwr_capacity'+i).focus();
				return false;
			}
		}
	}
	/*if(document.getElementById('cwr_total').value=="")
	{
	   alert('Please Enter CWR in Total Field');
	   document.getElementById('cwr_total').focus();
	   return false;
	}*/
	
      if(document.getElementById('cwr_total').value<document.getElementById('cwr_sc_st').value)
	  {
		  alert('Please Check!No. of SC/ST Basti should not Greater Than Total No. of CWR');
		  document.getElementById('cwr_sc_st').focus();
		  return false;
	  }
   
	
	
	/*if(document.getElementById('cwr_sc_st').value=="")
	{
	   alert('Please Enter CWR in SC/ST Basti Field');
	   document.getElementById('cwr_sc_st').focus();
	   return false;
	}*/
	/*if(document.getElementById('glsr_capacity').value=="")
	{
	   alert('Please Enter GLSR in Capacity Field');
	   document.getElementById('glsr_capacity').focus();
	   return false;
	}
	if(document.getElementById('glsr_total').value=="")
	{
	   alert('Please Enter GLSR in Total No. Field');
	   document.getElementById('glsr_total').focus();
	   return false;
	}*/
	if(document.getElementById('glsr_total').value=="")
	{
		var r=confirm('If You have Data for GLSR Field Then Click OK Otherwise Click Cancel');
    	if(r==true)
		{
		
			document.getElementById('glsr_total').focus();
			return false;
		}
	}
	if(document.getElementById('glsr_total').value!="")
	{
	
		var countglsr=document.getElementById('glsrcount').value;
		for(var i=1;i<=countglsr;i++)
		{
			if(document.getElementById('glsr_total').value!="" && document.getElementById('glsr_capacity'+i).value=="")
			{
				alert('Please Enter Capacity in GLSR Field'+i);
				document.getElementById('glsr_capacity'+i).focus();
				return false;
			}
		}
	}
	
	//if(document.getElementById('glsr_sc_st').value!=)
   //{
      if(document.getElementById('glsr_total').value<document.getElementById('glsr_sc_st').value)
	  {
		  alert('Please Check!No. of SC/ST Basti should not Greater Than Total No. of GLSR');
		  document.getElementById('glsr_sc_st').focus();
		  return false;
	  }
   //}
	
	
	
	/*if(document.getElementById('glsr_sc_st').value=="")
	{
	   alert('Please Enter GLSR in SC/ST Basti Field');
	   document.getElementById('glsr_sc_st').focus();
	   return false;
	}*/
	/*if(document.getElementById('glr_capacity').value=="")
	{
	   alert('Please Enter GLR in Capacity Field');
	   document.getElementById('glr_capacity').focus();
	   return false;
	}
	if(document.getElementById('glr_total').value=="")
	{
	   alert('Please Enter GLR in Total No. Field');
	   document.getElementById('glr_total').focus();
	   return false;
	}*/
	if(document.getElementById('glr_total').value=="")
	{
		var r=confirm('If You have Data for GLR Field Then Click OK Otherwise Click Cancel');
    	if(r==true)
		{
		
			document.getElementById('glr_total').focus();
			return false;
		}
	}
	if(document.getElementById('glr_total').value!="")
	{
	
		var countglr=document.getElementById('glrcount').value;
		for(var i=1;i<=countglr;i++)
		{
			if(document.getElementById('glr_total').value!="" && document.getElementById('glr_capacity'+i).value=="")
			{
				alert('Please Enter Capacity in GLR Field'+i);
				document.getElementById('glr_capacity'+i).focus();
				return false;
			}
		}
	}
	
	
	//if(document.getElementById('glr_sc_st').value!="NP")
   //{
      if(document.getElementById('glr_total').value<document.getElementById('glr_sc_st').value)
	  {
		  alert('Please Check!No. of SC/ST Basti should not Greater Than Total No. of GLR');
		  document.getElementById('glr_sc_st').focus();
		  return false;
	  }
   //}
	
	
	
	/*if(document.getElementById('glr_sc_st').value=="")
	{
	   alert('Please Enter GLR in SC/ST Basti Field');
	   document.getElementById('glr_sc_st').focus();
	   return false;
	}*/
	/*if(document.getElementById('ohsr_capacity').value=="")
	{
	   alert('Please Enter OHSR Capacity Field');
	   document.getElementById('ohsr_capacity').focus();
	   return false;
	}
	if(document.getElementById('ohsr_total').value=="")
	{
	   alert('Please Enter OHSR in Total No. Field');
	   document.getElementById('ohsr_total').focus();
	   return false;
	}*/
	if(document.getElementById('ohsr_total').value=="")
	{
		var r=confirm('If You have Data for OHSR Field Then Click OK Otherwise Click Cancel');
    	if(r==true)
		{
		
			document.getElementById('ohsr_total').focus();
			return false;
		}
	}
	if(document.getElementById('ohsr_total').value!="")
	{
	
		var countohsr=document.getElementById('ohsrcount').value;
		for(var i=1;i<=countohsr;i++)
		{
			if(document.getElementById('ohsr_total').value!="" && document.getElementById('ohsr_capacity'+i).value=="")
			{
				alert('Please Enter Capacity in OHSR Field'+i);
				document.getElementById('ohsr_capacity'+i).focus();
				return false;
			}
		}
	}
	
	
	//if(document.getElementById('ohsr_sc_st').value!="NP")
   //{
      if(document.getElementById('ohsr_total').value<document.getElementById('ohsr_sc_st').value)
	  {
		  alert('Please Check!No. of SC/ST Basti should not Greater Than Total No. of OHSR');
		  document.getElementById('ohsr_sc_st').focus();
		  return false;
	  }
   //}
	
	
	/*if(document.getElementById('ohsr_sc_st').value=="")
	{
	   alert('Please Enter OHSR in SC/ST Basti Field');
	   document.getElementById('ohsr_sc_st').focus();
	   return false;
	}*/
	/*if(document.getElementById('ris_material'+i)[document.getElementById('ris_material'+i).selectedIndex].value==0)
	{
		var r=confirm('Are you sure select the rising material');
    	if(r==true)
		{
		
			document.getElementById('sub_total').focus();
			return false;
		}
	}
	if(document.getElementById('sub_total').value!="")
	{*/
	
	
	

		if(document.getElementById('ris_material1')[document.getElementById('ris_material1').selectedIndex].value==0)
		{
			var r=confirm('If You have Data for Rising Material Field Then Click OK Otherwise Click Cancel');
    		if(r==true)
			{
		
				document.getElementById('ris_material1').focus();
				return false;
			}
		}
	for(var i=1;i<=6;i++)
	{
		if(document.getElementById('ris_material'+i)[document.getElementById('ris_material'+i).selectedIndex].value!=0 && document.getElementById('ris_size'+i)[document.getElementById('ris_size'+i).selectedIndex].value==0)
		{
			alert('Please Select Rising Size'+i);
			document.getElementById('ris_size'+i).focus();
			return false;
		}
		if(document.getElementById('ris_material'+i)[document.getElementById('ris_material'+i).selectedIndex].value!=0 && document.getElementById('ris_size'+i)[document.getElementById('ris_size'+i).selectedIndex].value!=0 && document.getElementById('ris_length'+i).value=="")
		{
			alert('Please Select Rising Length'+i);
			document.getElementById('ris_length'+i).focus();
			return false;
		}
		/*if(document.getElementById('ris_size'+i).value=="")
		{
			alert('Please Select Rising Size'+i);
			document.getElementById('ris_size'+i).focus();
			return false;
		}	
		if(document.getElementById('ris_length'+i).value=="")
		{
			alert('Please Select Rising Length'+i);
			document.getElementById('ris_length'+i).focus();
			return false;
		}*/
	}
	if(document.getElementById('dis_material1')[document.getElementById('dis_material1').selectedIndex].value==0)
		{
			var r=confirm('If You have Data for Distributed Material Field Then Click OK Otherwise Click Cancel');
    		if(r==true)
			{
		
				document.getElementById('dis_material1').focus();
				return false;
			}
		}
	
	for(var i=1;i<=6;i++)
	{
		if(document.getElementById('dis_material'+i)[document.getElementById('dis_material'+i).selectedIndex].value!=0 && document.getElementById('dis_size'+i)[document.getElementById('dis_size'+i).selectedIndex].value==0)
		{
			alert('Please Select Distribution Material Size'+i);
			document.getElementById('dis_size'+i).focus();
			return false;
		}
		if(document.getElementById('dis_material'+i)[document.getElementById('dis_material'+i).selectedIndex].value!=0 && document.getElementById('dis_size'+i)[document.getElementById('dis_size'+i).selectedIndex].value!=0 && document.getElementById('dis_length'+i).value=="")
		{
			alert('Please Select Distribution Length'+i);
			document.getElementById('dis_length'+i).focus();
			return false;
		}
		/*{
			alert('Please Select Distribution Size'+i);
			document.getElementById('dis_size'+i).focus();
			return false;
		}	
		if(document.getElementById('dis_length'+i).value=="")
		{
			alert('Please Select Distribution Length'+i);
			document.getElementById('dis_length'+i).focus();
			return false;
		}*/
	}
	
	
	
	/*if(document.getElementById('psp_total').value=="")
	{
	   alert('Please Enter PSP Total Field');
	   document.getElementById('psp_total').focus();
	   return false;
	}*/
	//if(document.getElementById('psp_sc_st').value!="NP")
   //{
      if(document.getElementById('psp_total').value<document.getElementById('psp_sc_st').value)
	  {
		  alert('Please Check!No. of SC/ST Basti should not Greater Than Total No. of PSP');
		  document.getElementById('psp_sc_st').focus();
		  return false;
	  }
   //}
	
	if(document.getElementById('psp_total').value=="")
	{
		var r=confirm('If You have Data for PSP Field Then Click OK Otherwise Click Cancel');
    	if(r==true)
		{
		
			document.getElementById('psp_total').focus();
			return false;
		}
	}
	if(document.getElementById('psp_total').value!="")
	{
	//var r=confirm('Are you sure fill the PSP');
    //if(r==true)
	//{
		//document.getElementById('psp_total').focus();
		//return false;
		var countpsp=document.getElementById('pspcount').value;
		for(var i=1;i<=countpsp;i++)
		{
	  		if(document.getElementById('psp_taps'+i).value=="")
	  		{
	   			alert('Please Enter PSP Taps No.'+i);
	   			document.getElementById('psp_taps'+i).focus();
	   			return false;
	  		}
		  if(document.getElementById('psp_loc'+i).value=="")
		  {
		   alert('Please Enter PSP Location'+i);
		   document.getElementById('psp_loc'+i).focus();
		   return false;
		  }
		
		  var chks = document.getElementsByName('psp_glr'+i);
		  var hasChecked = false;
		 //if(!chk.checked)
		 //{
		  for (var j = 0; j < chks.length; j++)
		  {
			if (chks[j].checked)
			{
				hasChecked = true;
				break;
			}
		  }
		 if (hasChecked == false)
		 {
			alert('Please Check at Least One in Attached with GLR Field'+i);
			return false;
		 }
		 /*var rad=document.getElementById('psp_glr'+i);
		 var rad1=document.getElementById('glr_total'+i);
		 var rad2=document.getElementById('glr_loc'+i);
		 if(rad.checked && rad1.value=="")
		 {
		   alert('Please Enter the Fields GLR Total'+i);
		   rad1.focus();
		   return false;
		 }
		 if(document.getElementById('glr_sc_st'+i).value!="NP")
	   {
		  if(document.getElementById('glr_total'+i).value<document.getElementById('glr_sc_st'+i).value)
		  {
			  alert('Please Check!No. of SC/ST Basti Not Greater Than Total No. of GLR'+i);
			  document.getElementById('glr_sc_st'+i).focus();
			  return false;
		  }
	   }
		 
		 
		 if(rad.checked && rad2.value=="")
		 {
		   alert('Please Enter the Fields GLR Location'+i);
		   rad2.focus();
		   return false;
		 }*/
		 var chks = document.getElementsByName('psp_cwt'+i);
		 var hasChecked = false;
		 //if(!chk.checked)
		 //{
		  for (var j = 0; j < chks.length; j++)
		  {
			if (chks[j].checked)
			{
				hasChecked = true;
				break;
			 }
		  }
		 if (hasChecked == false)
		 {
			alert('Please Check at Least One in Attached with CWT Field'+i);
			return false;
		 }
		 /*var rad=document.getElementById('psp_cwt'+i);
		 var rad1=document.getElementById('cwt_total'+i);
		 var rad2=document.getElementById('cwt_loc'+i);
		 if(rad.checked && rad1.value=="")
		 {
		   alert('Please Enter the Fields CWT Total'+i);
		   rad1.focus();
		   return false;
		 }
		 if(document.getElementById('cwt_sc_st'+i).value!="NP")
	   {
		  if(document.getElementById('cwt_total'+i).value<document.getElementById('cwt_sc_st'+i).value)
		  {
			  alert('Please Check!No. of SC/ST Basti Not Greater Than Total No. of CWT'+i);
			  document.getElementById('cwt_sc_st'+i).focus();
			  return false;
		  }
	   }
		 
		 
		 if(rad.checked && rad2.value=="")
		 {
		   alert('Please Enter the Fields CWT Location'+i);
		   rad2.focus();
		   return false;
		 }*/
		 var chks = document.getElementsByName('sc_st'+i);
		 var hasChecked = false;
		 //if(!chk.checked)
		 //{
		  for (var j = 0; j < chks.length; j++)
		  {
			if (chks[j].checked)
			{
				hasChecked = true;
				break;
			}
		  }
		 if (hasChecked == false)
		 {
			alert('Please Check at Least One in SC/ST Basti'+i);
			return false;
		 }


		}
	}
}



function validate4()
{
	var counthab=document.getElementById('habcount').value;
	for(var i=1;i<counthab;i++)
	{
		var chks = document.getElementsByName('critical'+i);
    	//alert(chks);
		var hasChecked = false;
     	for (var j = 0; j < chks.length; j++)
     	{
     		if (chks[j].checked)
     		{
	 			//alert(chks[i].value);
	 			hasChecked = true;
     			break;
     		}
	 	}
	 
	 	if (hasChecked == false)
    	{
    		alert("Please Select at Least One in Critical Field"+i);
    		return false;
    	}
		var rad = document.getElementById('critical'+i);
		//alert(rad.value);
		
			if(rad.checked)
			{
				var chk = document.getElementsByName('CH_quality'+i+'[]');
    			var hasChecked = false;
     			for (var j = 0; j < chk.length; j++)
     			{
     				if (chk[j].checked)
     				{
	 					//alert(chks[i].value);
	 					hasChecked = true;
     					break;
     				}
	 			}
	 
	 			if (hasChecked == false)
    			{
    				alert("Please Select at Least One Critical Village in Terms of Quality"+i);
    				return false;
    			}
				var chk = document.getElementsByName('CH_quantity'+i+'[]');
    			var hasChecked = false;
     			for (var j = 0; j < chk.length; j++)
     			{
     				if (chk[j].checked)
     				{
	 					//alert(chks[i].value);
	 					hasChecked = true;
     					break;
     				}
	 			}
	 
	 			if (hasChecked == false)
    			{
    				alert("Please Select at Least One Critical Village in Terms of Quantity"+i);
    				return false;
    			}
			
		}
		
		
	}
	/*var chks = document.getElementsByName('CH_quantity');
    var hasChecked = false;
     for (var i = 0; i < chks.length; i++)
     {
     if (chks[i].checked)
     {
	 //alert(chks[i].value);
	 hasChecked = true;
     break;
     }
	 }
	 
	 if (hasChecked == false)
    {
    alert("Please Select at Least One Critical Village in Terms of Quantity");
    return false;
    }*/
	
	/*var counthab=document.getElementById('habcount').value
	for(var i=1;i<counthab;i++)
	{
		if(document.getElementById('water_supply_no'+i).value=="")
		{
			alert('Please Enter Water Supply No.'+i);
			document.getElementById('water_supply_no'+i).focus();
			return false;
		}
		if(document.getElementById('water_supply_qty'+i).value=="")
		{
			alert('Please Enter Water Supply Quantity'+i);
			document.getElementById('water_supply_qty'+i).focus();
			return false;
		}
		if(document.getElementById('water_supply_area'+i).value=="")
		{
			alert('Please Enter Water Supply Area Covered'+i);
			document.getElementById('water_supply_area'+i).focus();
			return false;
		}
	}*/
	
	
	
}

function numeric(field)
{
    var valid = "0123456789"
    var ok = "yes";
    var temp;
   for (var i=0; i<field.value.length; i++)
   {
   temp = "" + field.value.substring(i, i+1);
   if (valid.indexOf(temp) == "-1") ok = "no";
   }
   if (ok == "no")
   {
   alert("Invalid entry! Only Integer Values are Accepted!");
   //field.focus();
   field.select();
   return false;
   }
}


function float(field)
{
	
	var val = field.value;
	if(isNaN(val))
	{
		alert("Invalid entry! Only Integer and Float Values are Accepted!");
		field.focus();
		return false;
	}
}


function alphabet(field)
{
    var valid = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ "
    var ok = "yes";
    var temp;
   for (var i=0; i<field.value.length; i++)
   {
   temp = "" + field.value.substring(i, i+1);
   if (valid.indexOf(temp) == "-1") ok = "no";
   }
	if (ok == "no")
	{
	alert("Invalid entry! Only Alphabetic Characters are Accepted!");
	//field.focus();
	field.select();
	return false;
    }

}

function validate3()
{
     var chks = document.getElementsByName('current_status');
     var hasChecked = false;
     for (var j = 0; j < chks.length; j++)
     {
     if (chks[j].checked)
     {
     hasChecked = true;
     break;
     }
     }
	 if (hasChecked == false)
    {
    alert("Please Select at Least One Current Status of Schemes");
    return false;
    }
	
	if(document.getElementById('current_status').value=="operation")
	{
		if(document.getElementById('actual_water_supply').value=="")
		{
			alert('Please Enter Actual Water Supply');
			document.getElementById('actual_water_supply').focus();
			return false;
		}
	 	if(document.getElementById('frequency_supply')[document.getElementById('frequency_supply').selectedIndex].value==0)
		{
			alert('Please Select Frequency of Supply');
			document.getElementById('frequency_supply').focus();
			return false;
		}
	
		if(document.getElementById('duration_of_supply').value=="")
		{
			alert('Please Enter Duration of Supply');
			document.getElementById('duration_of_supply').focus();
			return false;
		}
		if(document.getElementById('type_of_disinfection')[document.getElementById('type_of_disinfection').selectedIndex].value==0)
		{
			alert('Please Select Type of Disinfection');
			document.getElementById('type_of_disinfection').focus();
			return false;
		}
		
		if(document.getElementById('type_of_disinfection')[document.getElementById('type_of_disinfection').selectedIndex].value=='Other' && document.getElementById('type_other').value=="")
		{
			alert('Please Enter Disinfection of Other Field');
			document.getElementById('type_other').focus();
			return false;
		}
		if(document.getElementById('disinfection_frequecy')[document.getElementById('disinfection_frequecy').selectedIndex].value==0)
		{
			alert('Please Select Disinfection Frequency');
			document.getElementById('disinfection_frequecy').focus();
			return false;
		}
	
	
	/*if(document.getElementById('type_of_disinfection').value=="")
	{
		alert('Please Enter Type of Disinfection');
		document.getElementById('type_of_disinfection').focus();
		return false;
	}
	 var chks = document.getElementsByName('disinfection_frequecy');
     var hasChecked = false;
     for (var j = 0; j < chks.length; j++)
     {
     if (chks[j].checked)
     {
     hasChecked = true;
     break;
     }
     }
	 if (hasChecked == false)
    {
    alert("Please Select at Least One Disinfection Frequency");
    return false;
    }*/
		if(document.getElementById('Quantity_of_chemical').value=="")
		{
			alert('Please Enter Quantity of Chemical. If You Have No Data Fill 0');
			document.getElementById('Quantity_of_chemical').focus();
			return false;
		}
	}
	
	/*if(document.getElementById('manpower_o_m').value=="")
	{
		alert('Please Enter Manpower Involved in O&M');
		document.getElementById('manpower_o_m').focus();
		return false;
	}*/
	if(Number(document.getElementById('manpower_o_m').value) < Number(document.getElementById('tech_emp').value))
	{
		alert('Total Technical Personnel No. should not Greater Than Total Manpower Displayed in O & M');
		document.getElementById('tech_emp').focus();
		return false;
	}
	
	
		var chks = document.getElementsByName('exist_water_supplied'+'[]');
    	 var hasChecked = false;
     	for (var j = 0; j < chks.length; j++)
     	{
     		if (chks[j].checked)
     		{
     			hasChecked = true;
     			break;
     		}
     }
	 if (hasChecked == false)
    {
    alert("Please Select at Least One in Existing Means to Quantify Water Supplied");
    return false;
    }
	
	/*if(document.getElementById('water_connection_domestic').value=="")
	{
		alert('Please Enter Water Connection in Domestic');
		document.getElementById('water_connection_domestic').focus();
		return false;
	}
	if(document.getElementById('water_connection_nondomestic').value=="")
	{
		alert('Please Enter Water Connection in Non Domestic');
		document.getElementById('water_connection_nondomestic').focus();
		return false;
	}
	if(document.getElementById('water_connection_industrial').value=="")
	{
		alert('Please Enter Water Connection in Industrial');
		document.getElementById('water_connection_industrial').focus();
		return false;
	}*/
	 var chk=document.getElementById('dom');
	 var chks = document.getElementsByName('domestic');
     var hasChecked = false;
	 if(chk.checked)
	 {
		 for (var j = 0; j < chks.length; j++)
		 {
			 if (chks[j].checked)
			 {
			 hasChecked = true;
			 break;
			 }
		 }
		 if (hasChecked == false)
		{
		alert("Please Select at Least One Water Billing System in Domestic");
		return false;
		}
	 }
	 var chk=document.getElementById('non_dom');
	 var chks = document.getElementsByName('non_domestic');
     var hasChecked = false;
	 if(chk.checked)
	 {
		 for (var j = 0; j < chks.length; j++)
		 {
			if (chks[j].checked)
			 {
			 hasChecked = true;
			 break;
			 }
		 }
		 if (hasChecked == false)
		{
		alert("Please Select at Least One Water Billing System in Non Domestic");
		return false;
		}
	 }
	 var chk=document.getElementById('indus');
	 var chks = document.getElementsByName('industrial');
     var hasChecked = false;
     if(chk.checked)
	 {
		 for (var j = 0; j < chks.length; j++)
		 {
			 if (chks[j].checked)
			 {
			 hasChecked = true;
			 break;
			 }
		 }
		 if (hasChecked == false)
		{
		alert("Please Select at Least One Water Billing System in Industrial");
		return false;
		}
	 }
	/*if(document.getElementById('wbr_09_10').value=="")
	{
		alert('Please Enter Water Bills Raised in 2009-10');
		document.getElementById('wbr_09_10').focus();
		return false;
	}
	if(document.getElementById('wbr_08_09').value=="")
	{
		alert('Please Enter Water Bills Raised in 2008-09');
		document.getElementById('wbr_08_09').focus();
		return false;
	}
	if(document.getElementById('wbr_07_08').value=="")
	{
		alert('Please Enter Water Bills Raised in 2007-08');
		document.getElementById('wbr_07_08').focus();
		return false;
	}
	
	if(document.getElementById('rg_09_10').value=="")
	{
		alert('Please Enter Revenue Generated in 2009-10');
		document.getElementById('rg_09_10').focus();
		return false;
	}
	
	if(document.getElementById('rg_08_09').value=="")
	{
		alert('Please Enter Revenue Generated in 2008-09');
		document.getElementById('rg_08_09').focus();
		return false;
	}
	if(document.getElementById('rg_07_08').value=="")
	{
		alert('Please Enter Revenue Generated in 2007-08');
		document.getElementById('rg_07_08').focus();
		return false;
	}
	if(document.getElementById('mpc_fy_09_10').value=="")
	{
		alert('Please Enter Annual Operation Maintenance in Man Power Cost 2009-10');
		document.getElementById('mpc_fy_09_10').focus();
		return false;
	}
	
	if(document.getElementById('mpc_fy_08_09').value=="")
	{
		alert('Please Enter Annual Operation Maintenance in Man Power Cost 2008-09');
		document.getElementById('mpc_fy_08_09').focus();
		return false;
	}
	if(document.getElementById('mpc_fy_07_08').value=="")
	{
		alert('Please Enter Annual Operation Maintenance in Man Power Cost 2007-08');
		document.getElementById('mpc_fy_07_08').focus();
		return false;
	}
	if(document.getElementById('mcmr_fy_09_10').value=="")
	{
		alert('Please Enter Annual Operation Maintenance in Machinery Repairs 2009-10');
		document.getElementById('mcmr_fy_09_10').focus();
		return false;
	}
	
	if(document.getElementById('mcmr_fy_08_09').value=="")
	{
		alert('Please Enter Annual Operation Maintenance in Machinery Repairs 2008-09');
		document.getElementById('mcmr_fy_08_09').focus();
		return false;
	}
	if(document.getElementById('mcmr_fy_07_08').value=="")
	{
		alert('Please Enter Annual Operation Maintenance in Machinery Repairs 2007-08');
		document.getElementById('mcmr_fy_07_08').focus();
		return false;
	}
	if(document.getElementById('mcpr_fy_09_10').value=="")
	{
		alert('Please Enter Annual Operation Maintenance in Pipe Repairs 2009-10');
		document.getElementById('mcpr_fy_09_10').focus();
		return false;
	}
	
	if(document.getElementById('mcpr_fy_08_09').value=="")
	{
		alert('Please Enter Annual Operation Maintenance in Pipe Repairs 2008-09');
		document.getElementById('mcpr_fy_08_09').focus();
		return false;
	}
	if(document.getElementById('mcpr_fy_07_08').value=="")
	{
		alert('Please Enter Annual Operation Maintenance in Pipe Repairs 2007-08');
		document.getElementById('mcpr_fy_07_08').focus();
		return false;
	}
	if(document.getElementById('pc_fy_09_10').value=="")
	{
		alert('Please Enter Annual Operation Maintenance in Power Cost 2009-10');
		document.getElementById('pc_fy_09_10').focus();
		return false;
	}
	if(document.getElementById('pc_fy_08_09').value=="")
	{
		alert('Please Enter Annual Operation Maintenance in Power Cost 2008-09');
		document.getElementById('pc_fy_08_09').focus();
		return false;
	}
	if(document.getElementById('pc_fy_07_08').value=="")
	{
		alert('Please Enter Annual Operation Maintenance in Power Cost 2007-08');
		document.getElementById('pc_fy_07_08').focus();
		return false;
	}
	if(document.getElementById('cc_fy_09_10').value=="")
	{
		alert('Please Enter Annual Operation Maintenance in Chemical Cost 2009-10');
		document.getElementById('cc_fy_09_10').focus();
		return false;
	}
	if(document.getElementById('cc_fy_08_09').value=="")
	{
		alert('Please Enter Annual Operation Maintenance in Chemical Cost 2008-09');
		document.getElementById('cc_fy_08_09').focus();
		return false;
	}
	if(document.getElementById('cc_fy_07_08').value=="")
	{
		alert('Please Enter Annual Operation Maintenance in Chemical Cost 2007-08');
		document.getElementById('cc_fy_07_08').focus();
		return false;
	}
	if(document.getElementById('time_taken').value=="")
	{
		alert('Please Enter Time Taken to Address the Complaint Field');
		document.getElementById('time_taken').focus();
		return false;
	}
	var chks = document.getElementsByName('prev_main_mech_place');
    var hasChecked = false;
     for (var i = 0; i < chks.length; i++)
     {
     	if (chks[i].checked)
     	{
	 
	 		hasChecked = true;
     		break;
     	}
	 }
	 
	 if (hasChecked == false)
    {
    alert("Please Select at Least One Preventive Maintenance Mechanism in Place");
    return false;
    }
	if(document.getElementById('exist_report_sys')[document.getElementById('exist_report_sys').selectedIndex].value==0)
		{
			alert('Please Select Existing Reporting System');
			document.getElementById('exist_report_sys').focus();
			return false;
		}
		
	if(document.getElementById('exist_report_sys')[document.getElementById('exist_report_sys').selectedIndex].value=='Other' && document.getElementById('report_other').value=="")
		{
			alert('Please Enter Existing Reporting System in Other Field');
			document.getElementById('report_other').focus();
			return false;
		}*/
		var chks = document.getElementsByName('exist_report_sys'+'[]');
    	var hasChecked = false;
     for (var i = 0; i < chks.length; i++)
     {
     	if (chks[i].checked)
     	{
	 		//alert(chks[i].value);
	 		hasChecked = true;
     		break;
     	}
	 }
	 
	 if (hasChecked == false)
    {
    	alert("Please Select at Least One Existing Reporting System");
    	return false;
    }
	
	var chks = document.getElementsByName('exist_report_sys'+'[]');
     var hasChecked = false;
     for (var i = 1; i < chks.length; i++)
     {
     	if (chks[i].checked)
     	{
	 		//alert(chks[i].value);
	 		if(chks[i].value=="Other" && document.getElementById('report_other').value=="")
	 		{
	    		alert("Please Enter Existing Reporting System in Other Field");
				document.getElementById('report_other').focus();
				return false;
	 		}
	 	}
	 }
	
	/*if(document.getElementById('exist_report_sys'+'[]').value=="Other" && document.getElementById('report_other').value=="")
		{
			alert('Please Enter Existing Reporting System in Other Field');
			document.getElementById('report_other').focus();
			return false;
		}*/
	
	
	
	if(document.getElementById('time_taken')[document.getElementById('time_taken').selectedIndex].value==0)
		{
			alert('Please Select Time Taken to Address the Complaint');
			document.getElementById('time_taken').focus();
			return false;
		}
	
	
	
	if(document.questionnaire1_3.nonsupply_water.checked || document.questionnaire1_3.poor_water_quality.checked || document.questionnaire1_3.absence_phed.checked || document.questionnaire1_3.polluted_src_water.checked || document.questionnaire1_3.distri_water_supply.checked)
    /*{
    	alert('Please Check at Least One Types of Complaint Received');
		return false;
    }
	else*/
	{
		if(document.getElementById('nonsupply_water').checked && document.getElementById('complaint_1').value=="")
		{
			alert('Please Enter Non Supply of Water due to Power Failure');
			document.getElementById('complaint_1').focus();
			return false;
		}
		if(document.getElementById('poor_water_quality').checked && document.getElementById('complaint_2').value=="")
		{
			alert('Please Enter Poor Water Quality');
			document.getElementById('complaint_2').focus();
		return false;
		}
		if(document.getElementById('absence_phed').checked && document.getElementById('complaint_3').value=="")
		{
		alert('Please Enter Absence of PHED Field Staff');
		document.getElementById('complaint_3').focus();
		return false;
		}
		if(document.getElementById('polluted_src_water').checked && document.getElementById('complaint_4').value=="")
		{
			alert('Please Enter Polluted Sources of Drinking Water');
			document.getElementById('complaint_4').focus();
			return false;
		}
		if(document.getElementById('distri_water_supply').checked && document.getElementById('complaint_5').value=="")
		{
			alert('Please Enter Distribution in Water Supply due to Poorly Maintained Water Supply Infrastructure');
			document.getElementById('complaint_5').focus();
			return false;
		}
	
	
	var a=document.getElementById('complaint_1').value;
	a1=Number(a);
	var b=document.getElementById('complaint_2').value;
	b1=Number(b);
	var c=document.getElementById('complaint_3').value;
	c1=Number(c);
	var d=document.getElementById('complaint_4').value;
	d1=Number(d);
	var e=document.getElementById('complaint_5').value;
	e1=Number(e);
	f=(a1+b1+c1+d1+e1);
	if(f!=100)
	{
		alert('Total Complaint Received Should be Equal to 100%');
		return false;
	}
}
	
	var chks = document.getElementsByName('institutional'+'[]');
    var hasChecked = false;
     for (var i = 0; i < chks.length; i++)
     {
     	if (chks[i].checked)
     	{
	 
	 		hasChecked = true;
    		 break;
     	}
	 }
	 
	 if (hasChecked == false)
    {
    	alert("Please Select at Least One PHED Institutional");
    	return false;
    }
	 var chks = document.getElementsByName('institutional'+'[]');
     var hasChecked = false;
     for (var i = 1; i < chks.length; i++)
     {
     	if (chks[i].checked)
     	{
	 		//alert(chks[i].value);
	 		if(chks[i].value=="" && document.getElementById('institutional_other').value=="")
	 		{
	    		alert("Please Enter PHED  Institutional Other Field");
				document.getElementById('institutional_other').focus();
				return false;
	 		}
	 	}
	 }
	var chks = document.getElementsByName('financial'+'[]');
    var hasChecked = false;
     for (var i = 0; i < chks.length; i++)
     {
     	if (chks[i].checked)
     	{
	 		//alert(chks[i].value);
	 		hasChecked = true;
    		 break;
    	 }
	 }
	 
	 if (hasChecked == false)
    {
    	alert("Please Select at Least One PHED Financial");
    	return false;
    }
	 var chks = document.getElementsByName('financial'+'[]');
     var hasChecked = false;
     for (var i = 1; i < chks.length; i++)
     {
     	if (chks[i].checked)
     	{
	 		//alert(chks[i].value);
	 		if(chks[i].value=="" && document.getElementById('financial_other').value=="")
	 		{
	    		alert("Please Enter PHED  Financial Other Field");
				document.getElementById('financial_other').focus();
				return false;
	 		}
	 	}
	 }
	var chks = document.getElementsByName('operational'+'[]');
    var hasChecked = false;
     for (var i = 0; i < chks.length; i++)
     {
     	if (chks[i].checked)
     	{
	 		//alert(chks[i].value);
	 		hasChecked = true;
     		break;
     	}
	 }
	 
	 if (hasChecked == false)
    {
    	alert("Please Select at Least One PHED Operational");
    	return false;
    }
	 var chks = document.getElementsByName('operational'+'[]');
     var hasChecked = false;
     for (var i = 1; i < chks.length; i++)
     {
     	if (chks[i].checked)
     	{
	 		//alert(chks[i].value);
	 		if(chks[i].value=="" && document.getElementById('operational_other').value=="")
	 		{
	    		alert("Please Enter PHED  Operational Other Field");
				document.getElementById('operational_other').focus();
				return false;
	 		}
	 	}
	 }
	
		
}

function setReadOnly33(valobj)
{
		//document.getElementById('household'+obj).style.backgroundcolor="#eeeeee";
		//document.getElementById('population_sc1').readonly=1;
		//document.getElementById('population_sc1').value="Not Applicable";
		document.getElementById('actual_water_supply').disabled=true;
		document.getElementById('frequency_supply').disabled=true;
		document.getElementById('duration_of_supply').disabled=true;
		document.getElementById('type_of_disinfection').disabled=true;
		document.getElementById('disinfection_frequecy').disabled=true;
		document.getElementById('Quantity_of_chemical').disabled=true;
		document.getElementById('current_status').value="defunct";
   
}
function setEnable33(valobj)
{

		//document.getElementById('population_sc1').style.backgroundcolor="#ffffff";
		//document.getElementById('population_sc1').readonly=0;
		//document.getElementById('population_sc1').value="";
		document.getElementById('actual_water_supply').disabled=false;
		document.getElementById('frequency_supply').disabled=false;
		document.getElementById('duration_of_supply').disabled=false;
		document.getElementById('type_of_disinfection').disabled=false;
		document.getElementById('disinfection_frequecy').disabled=false;
		document.getElementById('Quantity_of_chemical').disabled=false;
		document.getElementById('current_status').value="operation";
	
}

function enable_text1(status)
{
  status=!status;
  document.getElementById('complaint_1').disabled=status;
  document.getElementById('complaint_2').disabled=status;
  document.getElementById('complaint_3').disabled=status;
  document.getElementById('complaint_4').disabled=status;
  document.getElementById('complaint_5').disabled=status;
  document.getElementById('institutional_other').disabled=status;
  document.getElementById('financial_other').disabled=status;
  document.getElementById('operational_other').disabled=status;
  document.getElementById('type_other').disabled=status;
  document.getElementById('report_other').disabled=status;
  
  	document.questionnaire1_3.domestic[0].disabled = status;
	document.questionnaire1_3.domestic[1].disabled = status;
	document.questionnaire1_3.non_domestic[0].disabled = status;
	document.questionnaire1_3.non_domestic[1].disabled = status;
	document.questionnaire1_3.industrial[0].disabled = status;
	document.questionnaire1_3.industrial[1].disabled = status;

  
  
}
function chkenable(val)
{
  	val=!val;
  	document.questionnaire1_3.domestic[0].disabled = val;
	document.questionnaire1_3.domestic[1].disabled = val;
}

function chkenable1(val)
{
  	val=!val;
  	document.questionnaire1_3.non_domestic[0].disabled = val;
	document.questionnaire1_3.non_domestic[1].disabled = val;
}

function chkenable2(val)
{
  val=!val;
  	document.questionnaire1_3.industrial[0].disabled = val;
	document.questionnaire1_3.industrial[1].disabled = val;
}


function enable_text22(status)
{
  status=!status;
  document.getElementById('complaint_1').disabled=status;
  document.getElementById('complaint_1').value='';
  document.getElementById('complaint_1').focus();
}
function enable_text12(status)
{
  status=!status;
  document.getElementById('complaint_2').disabled=status;
  document.getElementById('complaint_2').value='';
  document.getElementById('complaint_2').focus();
}
function enable_text13(status)
{
  status=!status;
  document.getElementById('complaint_3').disabled=status;
  document.getElementById('complaint_3').value='';
  document.getElementById('complaint_3').focus();
}
function enable_text14(status)
{
  status=!status;
  document.getElementById('complaint_4').disabled=status;
  document.getElementById('complaint_4').value='';
  document.getElementById('complaint_4').focus();
}
function enable_text15(status)
{
  status=!status;
  document.getElementById('complaint_5').disabled=status;
  document.getElementById('complaint_5').value='';
  document.getElementById('complaint_5').focus();
}
function enable_text16(status)
{
  status=!status;
  document.getElementById('institutional_other').disabled=status;
  document.getElementById('institutional_other').focus();
  return false;
}
function enable_text17(status)
{
  status=!status;
  document.getElementById('financial_other').disabled=status;
  document.getElementById('financial_other').focus();
  return false;
}
function enable_text18(status)
{
  status=!status;
  document.getElementById('operational_other').disabled=status;
  document.getElementById('operational_other').focus();
  return false;
}

function enable_text19(status)
{
  status=!status;
  document.getElementById('institutional_other').disabled=status;
}
function enable_text20(status)
{
  status=!status;
  document.getElementById('financial_other').disabled=status;
}
function enable_text21(status)
{
  status=!status;
  document.getElementById('operational_other').disabled=status;
}

function enable_text23(status)
{
	if(document.getElementById('type_of_disinfection')[document.getElementById('type_of_disinfection').selectedIndex].value=='Other')
	{
  		status=!status;
  		document.getElementById('type_other').disabled=status;
  		document.getElementById('type_other').focus();
	}
	else
	{
		document.getElementById('type_other').disabled=true;	
	}
}

function enable_text24(status)
{
	
  		status=!status;
  		document.getElementById('report_other').disabled=status;
  		document.getElementById('report_other').focus();
		document.getElementById('exist_report_sys'+'[]').value="Other";
		
	
}





